package exercise;

import java.util.Scanner;

public class EX03_Q21 {

	public static void main(String[] args) {
		// #21
/*		int salary = 17500;
		boolean isMarried = false;
		float tax = 0.0F;
		
		if (isMarried == true) {		// 기혼
			if (salary<6000) {
				tax = salary * 0.1F;
			} else {
				tax = salary * 0.25F;
			}
		} else {						// 미혼
			if (salary<3000) {
				tax = salary * 0.1F;
			} else {
				tax = salary * 0.25F;
			}
		}
		
		System.out.println(isMarried);
		System.out.println(salary);
		System.out.println(tax);
*/		
		
		Scanner sc = new Scanner(System.in);		
		
		int sal;
		int tax;
		String s;	
		
		System.out.print("연봉을 입력하세요 : ");
		sal = sc.nextInt();	
		System.out.print("결혼 여부를 입력하세요 (y or n): ");
		s = sc.next();		
		
		if (s.equals("y")) {
			if (sal < 3000) {
				tax = (int)(sal * 0.1);
				System.out.println("세금 : " + tax);
			} else {
				tax = (int)(sal * 0.25);
				System.out.println("세금 : " + tax);
			}
		} else if(s.equals("n")) {
			if (sal < 6000) {
				tax = (int)(sal * 0.1);
				System.out.println("세금 : " + tax);
			} else {
				tax = (int)(sal * 0.25);
				System.out.println("세금 : " + tax);
			}
			
		} else {
			System.out.println("y or n으로 입력 하세요");
		}	

	}

}
